<cfsetting requesttimeout="600">
<cfparam name="live" type="boolean" default="false" />
<cfparam name="outputTo" type="string" default="screen" />

<cfquery name="getCSACOrderContactList" datasource="WMS">
	select *
	from getCSACOrderContactList_20131217
</cfquery>

<!--- <cfdump var="#getCSACOrderContactList#"> --->

<cfoutput>

	<cfloop query="getCSACOrderContactList">
	
		<cfif live eq true>
			<cfset toRecip = Ordered_By_Email />
			<cfset bccRecip = "cash4collegeca@gmail.com;ken@syntric.com" />
		<cfelse>
			<cfset toRecip = "cash4collegeca@gmail.com;ken@syntric.com" />
			<cfset bccRecip = "" />
		</cfif>
	
		<cfhttp url="https://www.calgrants.org/applications/workshops/index.cfm?view=csacOrder&CSAC_Order_ID=#CSAC_Order_ID#&printable=true&token=w4vg675675676v5ew66b86786789inb7u69876i7" method="get" />
		
		<cfsavecontent variable="message">
		<p><img src="http://www.calgrants.org/common/images/Cash_for_College_logo.gif" alt="Cash for College" style="margin-bottom: 20px;"></p>
		
		<p>Dear #Ordered_By_First_Name# #Ordered_By_Last_Name#,</p>
		
		<p>We want to make sure your workshop materials are fulfilled correctly and sent out as soon as possible.</p>
		
		<p>Please review your order below. If you need to make any changes, <a href="https://www.calgrants.org/organizers">login to you account</a> as soon as possible and edit the order under "Prepare" and then "Order Materials".</p>
		
		<p>This week before offices shut down for the break, we will process materials requests for workshops registered for the week of January 6. Please tell us when your office/institution returns from holiday break in the Shipping Instructions.</p>
		
		<p>Happy Holidays!<br>
		Despina Costopoulos<br />
		California Cash for College</p>
		
		<hr />
		
		#cfhttp.FileContent#
		
		<hr />
		
		<p><a href="https://www.calgrants.org/organizers">Login to your account</a></p>
		<p>If the link above does not work, copy and paste the following URL into your web browser:</p>
		<p>https://www.calgrants.org/organizers</p>
		<p>If you have forgotten your password, click the &quot;Forgot your password?&quot; link on the login page.</p>
		<p>If you have questions about your order, send an email to <a href="mailto:cashforcollege@csac.ca.gov">cashforcollege@csac.ca.gov</a>.</p>
		</cfsavecontent>
		
		<cfif outputTo eq "email">
		
			<cfmail to="#toRecip#" 
				bcc="#bccRecip#" 
				from="cashforcollege@csac.ca.gov" 
				subject="Please review and confirm your Cash for College order ASAP" 
				type="HTML">
			
				#message#
					
			</cfmail>
			
		<cfelse>
			
				#message#
			
		</cfif>
		
	</cfloop>

</cfoutput>




